import pytest
import selenium.webdriver.common.by
from selenium import  webdriver


@pytest.fixture
def log_print():
    print("开启日志")
    yield
    print("关闭日志")

@pytest.fixture()
def database_clean(log_print):
    print("链接数据库，清理数据库内容")
    yield
    print("断开数据库的链接")

@pytest.fixture()
def get_driver(database_clean):
    driver = webdriver.Firefox()
    print("打开浏览器")
    driver.get("https://www.baidu.com/")
    yield driver
    print("关闭浏览器")

def test001(get_driver):
    print("打开ui测试代码")